package com.example.qixin0314.Activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.qixin0314.R;

public class NewsActivity extends AppCompatActivity {

    private ImageView companySearch;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news);
        initView();
        initData();
    }

    private void initView() {
        WebView news_name = findViewById(R.id.news_name);
        TextView text_view = findViewById(R.id.text_view);
        Intent intent3 = getIntent();
        if (intent3.getExtras() != null) {
            String uri = intent3.getExtras().getString("uri");
            String name = intent3.getExtras().getString("name");
            news_name.loadUrl(uri);
            text_view.setText(name);

        }
    }
    private void initData(){
        companySearch=findViewById(R.id.company_search);
        companySearch.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                NewsActivity.this.finish();
            }
        });
    }

}